import { ref } from 'vue'
import router from '@/router'
/**
 * 根据路由名称加载
 * @returns
 */
export const component = () => {
  const template = ref('default')
  const maxSize = '1024kb'
  const accept = 'jpg/jpeg/png/gif'
  const url = ref() // uploaded url
  const getComponent = async () => {
    // test
    const routerName = router.currentRoute.value.name
    template.value = 'default'
  }

  // get uploaded api
  const getApi = () => {
    url.value = import.meta.env.VITE_UPLOAD_IMG_API
  }

  return {
    template,
    getComponent,
    getApi,
    url,
    maxSize,
    accept
  }
}
